import request from '@/utils/request'

// 城市信息获取
export const cityList = (num) => {
  return request({
    url: '/area/city',
    params: {
      level: num
    }
  })
}
// 热门城市信息获取
export const hotcity = () => {
  return request({
    url: '/area/hot'
  })
}
// 获取该城市信息
export const cityinfo = (cityname) => {
  return request({
    url: '/area/info',
    params: {
      name: cityname
    }
  })
}
// 获取该城市的房源信息
export const houseinfo = (id) => {
  return request.get('/area/map', {
    params: {id}
  })
}
// 获取房屋列表
export const getHouseList = (params)=>{
  console.log(params)
  return request({
    url: '/houses',
    params
  })
}
// 获取房屋查询条件
export const getHouseCondition = (id)=>{
  return request({
    url: '/houses/condition',
    params:{
      id
    }
  })
}
// 获取房屋详情
export const getHouseDetail = (id)=>{
  return request({
    url: `/houses/${id}`
  })
}

// 获取房源数据
export const getHhouseDistribution = (id)=>{
  return request({
    url: '/area/map',
    params:{
      id
    }
  })
}